<form name="frm" id="frm" action="<?php echo $this->site['base_url']?>admin_advertisement/save" method="post" enctype="multipart/form-data">

<table class="title" cellspacing="0" cellpadding="0">

  <tr>

    <td class="title_label"><?php echo Kohana::lang('advertisement_lang.tt_page')?></td>

    <td class="title_button"><button type="button" name="btn_back" class="button back" onclick="javascript:location.href='<?php echo $this->site['base_url']?>admin_advertisement/search'">

    <span><?php echo Kohana::lang('admin_lang.btn_back')?></span>

    </button>

    &nbsp;

    <button type="reset" name="btn_reset" class="button reset"/>

    <span><?php echo Kohana::lang('admin_lang.btn_reset')?></span>

    </button>

    &nbsp;

    <button type="submit" name="btn_save" class="button save">

    <span><?php echo Kohana::lang('admin_lang.btn_save')?></span>

    </button></td>

  </tr>

</table>

<table class="form" cellspacing="0" cellpadding="5">

  <tr>

    <td width="10%"><?php echo Kohana::lang('advertisement_lang.lbl_name')?>: <font color="#FF0000">*</font></td>

    <td><input name="txt_name" type="text" id="txt_name" value="<?php echo @$mr['adv_name']?>" size="50" maxlength="50"/></td>

  </tr>

  <tr>

    <td><?php echo Kohana::lang('advertisement_lang.lbl_url')?>:</td>

    <td><input name="txt_url" type="text" id="txt_url" value="<?php echo @$mr['adv_url']?>" size="50" /></td>

  </tr>

  <tr>

    <td><?php echo Kohana::lang('advertisement_lang.lbl_image')?>:</td>

    <td>

    	

        <?php 

		if(!empty($mr['adv_image'])){

		$ext = explode('.',$mr['adv_image']);

		$ext = $ext[1];

		} else {

			$ext='';

		}

		

		if(@$ext=='swf'){?>        

        <embed src="<?php echo $this->site['base_url']?>uploads/adv/<?php echo @$mr['adv_image']?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="100"></embed>

        <?php 

		} elseif(@$ext=='flv'){?>

        <div id="video">

        	You need to upgrade your Flash Player or to allow javascript to enable Website menu.</br>

        	<a href="http://www.adobe.com/go/getflashplayer">Get Flash Player</a>            

        </div>

        <script type='text/javascript' src='<?php echo $this->site['base_url']?>themes/plugins/mediaplayer/swfobject.js'></script>

        <script type='text/javascript'> 

        	var s1 = new SWFObject('<?php echo $this->site['base_url']?>themes/plugins/mediaplayer/player.swf','video','150','150','9'); 

        	s1.addParam('allowfullscreen','true'); 

        	s1.addParam('flashvars','file=<?php echo $this->site['base_url']?>uploads/adv/<?php echo @$mr['adv_image']?>')

        	s1.write('video'); 

        </script>

        

        <?php }else {

			if(!empty($mr['adv_image'])){

			?> 

        <img src="<?php echo $this->site['base_url']?>uploads/adv/<?php echo @$mr['adv_image']?>" height="100">

        <?php  } }?>

        <?php if(!empty($mr['adv_image'])){?>

        <a href="<?php echo $this->site['base_url']?>admin_advertisement/delete_image/<?php echo @$mr['adv_id']?>"><?php echo Kohana::lang('admin_lang.btn_delete')?></a>

        <?php }?>

        <br />

        <input name="attach_1" type="file" id="attach_1"/>

        <input name="hd_old_image" type="hidden" id="hd_old_image" value="<?php echo @$mr['adv_image']?>"/>

    </td>

  <tr>

    <td><?php echo Kohana::lang('advertisement_lang.lbl_begin_date')?>:</td>

    <td>

    <input name="txt_begin_date" type="text" id="txt_begin_date" value="<?php if(empty($mr['adv_begin_date']))echo date($this->site['site_short_date'],time()); else echo date($this->site['site_short_date'],$mr['adv_begin_date']?$mr['adv_begin_date']:'');?>" size="10" maxlength="10"/>

      <a onClick="if(self.gfPop)gfPop.fPopCalendar(document.frm.txt_begin_date);return false;"> <img align="absmiddle" src="<?php echo $this->site['base_url']?>/themes/plugins/calendar/calbtn.gif" border="0" ></a></td>

  </tr>

  <tr>

    <td><?php echo Kohana::lang('advertisement_lang.lbl_exp_date')?>:</td>

    <td>

    <input name="txt_expired_date" type="text" id="txt_expired_date" size="10" value="<?php if(empty($mr['adv_expired_date']))echo date($this->site['site_short_date'],time()); else echo date($this->site['site_short_date'],$mr['adv_expired_date']?$mr['adv_expired_date']:'');?>" />

  <a onClick="if(self.gfPop)gfPop.fPopCalendar(document.frm.txt_expired_date);return false;" >

  <img align="absmiddle" src="<?php echo $this->site['base_url']?>themes/plugins/calendar/calbtn.gif" border="0" ></a>

    </td>

  </tr>

  <tr>

    <td><?php echo Kohana::lang('advertisement_lang.lbl_position')?>:</td>

    <td><select name="txt_position">

      <option value="1" <?php if(@$mr['adv_position'] == 1) echo 'selected="selected"'?> ><?php echo Kohana::lang('advertisement_lang.lbl_left')?></option>

      <option value="2" <?php if(@$mr['adv_position'] == 2) echo 'selected="selected"'?>  ><?php echo Kohana::lang('advertisement_lang.lbl_right')?></option>

      <option value="3" <?php if(@$mr['adv_position'] == 3) echo 'selected="selected"'?> ><?php echo Kohana::lang('advertisement_lang.lbl_top')?></option>

      <option value="4" <?php if(@$mr['adv_position'] == 4) echo 'selected="selected"'?>  ><?php echo Kohana::lang('advertisement_lang.lbl_bottom')?></option>

      <option value="5" <?php if(@$mr['adv_position'] == 5) echo 'selected="selected"'?>  ><?php echo Kohana::lang('advertisement_lang.lbl_middle')?></option>

      </select></td>

  </tr>

  <tr>

    <td><?php echo Kohana::lang('advertisement_lang.lbl_open')?>:</td>

    <td><select name="txt_open" >

      <option value="1" <?php if(@$mr['adv_open']== 1) echo 'selected="selected"'?>><?php echo Kohana::lang('advertisement_lang.lbl_new_window')?></option>

      <option value="2" <?php if(@$mr['adv_open']== 2) echo 'selected="selected"'?>><?php echo Kohana::lang('advertisement_lang.lbl_same_window')?></option>

      </select></td>

  </tr>

  <tr>

    <td><?php echo Kohana::lang('admin_lang.lbl_order')?>:</td>

    <td><input name="txt_order" type="text" id="txt_order" class="text_number" value="<?php echo @$mr['adv_order']?>" size="10" maxlength="10"/></td>

  </tr>

  <tr>

    <td><?php echo Kohana::lang('admin_lang.lbl_status')?>:</td>

    <td><select name="txt_status" >

        <option value="1"<?php if(@$mr['adv_status'] == 1) echo 'selected="selected"'?>><?php echo Kohana::lang('admin_lang.lbl_active')?></option>

        <option value="0" <?php if(@$mr['adv_status'] == 0) echo 'selected="selected"'?>><?php echo Kohana::lang('admin_lang.lbl_inactive')?></option>

      </select></td>

  </tr>

  <tr>

    <td>&nbsp;</td>

    <td><input name="hd_id" type="hidden" id="hd_id" value="<?php echo @$mr['adv_id']?>"/></td>

  </tr>

</table>

</form>

<iframe width=174 height=189 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="<?php echo $this->site['base_url']?>themes/plugins/calendar/ipopeng.htm" scrolling="no" frameborder="0" 

style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">

</iframe>

